package Othello;

import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class StatusPanel extends JPanel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7664089057474066038L;
        
        JButton button1 = new JButton("Exit");
		JButton button2 = new JButton("Menu");  
		       
		/*for text field*/
		JTextField black_disk = new JTextField(); 
		JTextField white_disk = new JTextField();
		JTextField Turn = new JTextField(); 
		/*for label*/
		JLabel black_lb = new JLabel("BLACK");
		JLabel white_lb = new JLabel("WHITE");
		
		JLabel turn_lb = new JLabel("Turn");
		
	public StatusPanel(GameStatus st){
				

		String black = String.valueOf(st.black);
		String white = String.valueOf(st.white);
		String turn = String.valueOf(st.turn);
		
		
		setPreferredSize(new Dimension(200,800));
		//setting Layout
		setSize(200,800);
        setLayout(null);
        setBackground(Color.GRAY);
        //setBounds(800,0,200,800);


		
		
        /*set size, and location.*/
        button1.setBounds(50, 75, 100, 25);
        button2.setBounds(50, 40, 100, 25);
        
        /*set color for background.*/
        button1.setBackground(Color.yellow);
        button2.setBackground(Color.yellow);
        
        
        /*set label*/
        black_lb.setBounds(50,400,100,50);
        white_lb.setBounds(50,500,100,50);
        turn_lb.setBounds(50, 200, 100, 50);

       
        
        /*set Text field*/
        black_disk.setBounds(50,450, 100, 50);
        white_disk.setBounds(50, 550, 100, 50);
        Turn.setBounds(50, 250, 100, 50);
        
        
        /*set in Text Field*/
        black_disk.setText(black);
        white_disk.setText(white);
        Turn.setText(turn);
        /*Command for button.*/
        button1.addActionListener(new ClickAction());
        
        /*Add Button on Frame.*/
		add(button1);
        add(button2);
        
        add(black_disk);
        add(white_disk);
        add(Turn);
        
        add(black_lb);
        add(white_lb);
        add(turn_lb);        
	
	}
	
	public void update(int i, int j, int s){
		String black = String.valueOf(i);
		String white = String.valueOf(j);
		String turn = String.valueOf(s);
        black_disk.setText(black);
        white_disk.setText(white);
        Turn.setText(turn);
        
		
		
	}

}

